import Mock from 'mockjs'

const AreaList = []
const count = 20

for (let i = 0; i < count; i++) {
  AreaList.push(Mock.mock({
    id: '@integer(1, 3)',
    dispatchArea: '行驶区域@increment(1)',
    sort: '@integer(1, 255)',
    'isEnabled|1': [true, false]
  }))
}

export default [
  {
    url: '/v1/base/dispatchArea/queryDispatchAreaList',
    type: 'post',
    response: config => {
      return {
        code: 1,
        mesg: 'success',
        time: Mock.Random.date('T'),
        data: {
          totalCount: count,
          items: AreaList,
          limit: 10,
          page: 1
        }
      }
    }
  }
]
